package link.gpt.dao;

import link.gpt.pojo.EbookEntry;
import link.gpt.pojo.EbookEntryExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EbookEntryDao {
   long countByExample(EbookEntryExample example);

   int deleteByExample(EbookEntryExample example);

   int deleteByPrimaryKey(Integer id);

   int insert(EbookEntry record);

   int insertSelective(EbookEntry record);

   List<EbookEntry> selectByExample(EbookEntryExample example);

   EbookEntry selectByPrimaryKey(Integer id);

   int updateByExampleSelective(@Param("record") EbookEntry record, @Param("example") EbookEntryExample example);

   int updateByExample(@Param("record") EbookEntry record, @Param("example") EbookEntryExample example);

   int updateByPrimaryKeySelective(EbookEntry record);

   int updateByPrimaryKey(EbookEntry record);

   /**
    * 根据分类id查询
    * @param categoryId
    * @return
    */
   List<EbookEntry> findAllByCategoryIdAndPage(Integer categoryId);

   /**
    * 根据id查询
    * @param id
    * @return
    */
   EbookEntry findById(Integer id);
}